package concurrent;

/**
 * Created by xiao on 2017/12/17 下午10:30.
 */
public class MxProducer implements Runnable {
    private MxQueueBuffer buffer;
    private int no = 0;

    public MxProducer(MxQueueBuffer buffer) {
        this.buffer = buffer;
        new Thread(this, "Producer").start();
    }

    @Override
    public void run() {
        while (true) {
            buffer.put(new Integer[]{++no, ++no, ++no});
            System.out.println("Producer...");
        }
    }
}
